package com.inspur.ourhis_afterend.Controller;

import com.inspur.ourhis_afterend.Service.DemoService;
import com.inspur.ourhis_afterend.Tools.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/demo")
public class DemoController {

    @Autowired
    DemoService demoService;

    @RequestMapping("/findAll")
    public Result findAll() {
        try {
            System.out.println(demoService.findAll());
            return Result.success(demoService.findAll());
        } catch (Exception e) {
            e.printStackTrace();
            return Result.failure(e.toString());
        }
    }

}
